package com.ly.cyclictest.Test03;

import java.util.concurrent.CyclicBarrier;

public class Main03 {

    private static CyclicBarrier cyclicBarrier = new CyclicBarrier(10,new CyclicBarrierRun(10));

    public static void main(String[] args) {
        for (int i = 0 ; i < 10 ; i++){
            System.out.println("士兵"+i+"集合");
            Thread thread = new Thread(new Soldier("士兵" + i, cyclicBarrier));
            thread.start();
        }
    }
}
